﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;

namespace StateApp
{
    public partial class Visitors : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          //  Response.Write(Application["userCount"]);
       
            Bitmap myBitmap = new Bitmap(Server.MapPath("bg.png"));
           
            Graphics g = Graphics.FromImage(myBitmap);

            g.DrawString(Application["userCount"].ToString(), new Font("Tahoma", 12), Brushes.Red, new PointF(15, 15));
            MemoryStream ms = new MemoryStream();
            myBitmap.Save(ms, ImageFormat.Png);

            Response.ContentType = "image/png";
            //["Content-type"] = "image/bmp";
            Response.BinaryWrite(ms.ToArray());
        }
    }
}